# 将字典的键和值分别追加到 key_list 和 value_list 两个列表中，如：
#
# - key_list = []
#   value_list = []
#   info = {'k1':'v1','k2':'v2','k3':'v3'}

# 列表推导式
# info = {'k1':'v1','k2':'v2','k3':'v3'}
# key_list = [key for key in info.keys()]
# value_list = [value for value in info.values()]
# print(key_list)
# print(value_list)

# # 循环
# info = {'k1':'v1','k2':'v2','k3':'v3'}
# key_list = []
# value_list = []
# for i, j in info.items():
#     key_list.append(i)
#     value_list.append(j)
# print(key_list)
# print(value_list)


# 请将列表中的每个元素通过 "_" 链接起来。['李少奇','李启航','渣渣辉']
# li = ['李少奇','李启航','渣渣辉']
# print('_'.join(li))

# [2, 30, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"]
#
# - 将列表中的字符串"1"变成数字101
# - 将列表lis中的"tt"变成大写
# - 将列表中的数字3变成字符串"100"
# li = [2, 30, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"]
# li[3][2][1][2] = 101
# print(li)
# li[3][2][1][0] = li[3][2][1][0].upper()
# print(li)
# li[3][2][1][1] = '100'
# print(li)


# # l1 = [11, 22, 33, 44, 55]，请把索引为奇数对应的元素删除，不能一个一个删除
# l1 = [11, 22, 33, 44, 55]
# del l1[1::2]
# print(l1)

# # 有字符串"k: 1|k1:2|k2:3 |k3 :4" 处理成字典 {'k':1,'k1':2....}
# str1 = "k: 1|k1:2|k2:3 |k3 :4"
# li = str1.split('|')
# dic1 = {li[0][0]: int(li[0][-1]), li[1][0:2]: int(li[1][-1]), li[2][0:2]: int(li[2][-2]), li[3][0:2]: int(li[3][-1])}
# print(dic1)


dic1 = {'k1': "v1", "k2": "v2", "k3": [11,22,33]}
dic1['k3'].insert(0, 18)
print(dic1)